package kp.srs.client.gin;

import com.google.gwt.activity.shared.ActivityMapper;
import com.google.gwt.core.client.GWT;
import com.google.gwt.inject.client.GinModules;
import com.google.gwt.inject.client.Ginjector;
import com.google.gwt.place.shared.PlaceController;
import com.google.web.bindery.event.shared.EventBus;

/**
 * The Ginjector Interface. Import the GIN library into the Project, and also add the
 * module in the app's .gwt.xml file.
 * <p>
 * References:<br>
 * http://code.google.com/p/google-gin/wiki/GinTutorial
 * http://www.canoo.com/blog/2011/04/05/gwt-dependency-injection-recipes-using-gin/
 */
@GinModules(SrsGinModule.class)
public interface SrsGinjector extends Ginjector {
    
    // instantiates an Injector. This can be done in the "main program" but then
    // the reference to the Injector needs to be kept there. If defined here, it's
    // easier to always use the same instance of the Injector
    public static final SrsGinjector INSTANCE = GWT.create(SrsGinjector.class);
    
    // The App's Event Bus (a Singleton - one EventBus for all classes)
    public EventBus getEventBus();
    
    // The Place Controller
    public PlaceController getPlaceController();
    
    // The Activity Mapper
    public ActivityMapper getActivityMapper();    
}
